import React, { Component } from 'react';
import { Table } from 'antd';

class MissionTable extends Component {
  render() {
    const columns = [{
      title: 'Account',
      dataIndex: 'authUserName',
    }, {
      title: 'Part',
      render: (text, record) => (
        <div>
        {
          record.part === 'en' ? 'English' : 'Chinese'
        }
        </div>
      )
    }, {
      title: 'Remains',
      dataIndex: 'remains',
    }, {
      title: 'Operation',
      render: (text, record) => (
        <div className="edit-config">
          <div className="edit-text" onClick={() => this.props.openAssignModal(record)}>Assign</div>
        </div>
      )
    }];

    return (
      <div className="page-content mt176">
        <div className="list-table">
          <Table
            rowKey={(record, index) => index}
            className="select-table"
            dataSource={this.props.dataSource}
            columns={columns}
            pagination={false} />
        </div>
      </div>
    )
  }
}

export default MissionTable;
